package cn.tedu.egmybatis1.mapper;

import cn.tedu.egmybatis1.pojo.entity.Product;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface ProductMappper {
    @Insert("INSERT INTO product(id,title,price,stock) Values (#{id},#{title},#{price},#{stock})")
    void insertProduct(Product product);

    @Delete("DELETE FROM product WHERE id=#{id}")
    void deleteProduct(int id);

    @Update("UPDATE  product set price=#{price} WHERE id=#{id}")
    void update(double price,int id);
}

